package com.project.communitymanagement.common;

/**
 * @ProjectName: hotelNew
 * @Package: com.setup.mysql.common
 * @ClassName: ErrorCode
 * @Author: "XGP"
 * @Description:
 * @Date: 2021/09/13 11:23
 * @Version: 1.0
 */
public enum ErrorCode {

    SUCCESS(200,"ok"),
    FAILED(400,"请求失败"),
    AUTH_FAILED(401,"认证失败，或权限不足"),
    AUTH_EXPIRE(402,"认证失效，或权限不足"),
    ERROR(500,"system error"),
    ERROR_NULL(501,"空指针异常");
    /**
     * 业务码
     */
    private int code;
    /**
     * 描述
     */
    private String message;

     ErrorCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int code() {
        return this.code;
    }

    public String message() {
        return this.message;
    }
    /**
     * message允许编辑
     * @param message
     * @return
     */
    public ErrorCode setMessage(String message) {
        this.message = message;
        return this;
    }
}
